<template>
	<view class="layout">
		<view class="navBar navBarBg">
			<view class="statusBar" :style="{ height: statusBarHeight + 'px' }">

			</view>
			<view class="titleBar" :style="{ height: titleBarHeight + 'px' }">
				<view class="title">{{ title }}</view>
				<view class="search">
					<uni-icons type="search"></uni-icons>
					<text class="text">搜索</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		getStatusBarHeight,
		getTitleBarHeight
	} from '@/utils/system.js'
	defineProps({
		title: {
			type: String,
			default: '壁纸'
		}
	})

	const statusBarHeight = getStatusBarHeight()
	const titleBarHeight = getTitleBarHeight()
</script>

<style lang="scss" scoped>
	.navBar {
		position: fixed;
		top: 0;
		width: 100%;
		z-index: 10;
		padding: 0 15rpx 30rpx;

		.statusBar {}

		.titleBar {
			display: flex;
			align-items: center;
			height: 50rpx;
			line-height: 50rpx;

			.title {
				margin-right: 15rpx;
				font-size: 45rpx;
				font-weight: 700;
				color: $text-font-color-1;
			}

			.search {
				opacity: 0.8;
				background: rgba(255, 255, 255, 0.3);
				backdrop-filter: blur(50rpx);

				font-size: 28rpx;
				vertical-align: middle;

				width: 150rpx;
				height: 50rpx;
				padding: 0 20rpx;
				border-radius: 25rpx;
				border: 1rpx solid $text-font-color-3;

				.text {
					margin-right: 5rpx;
				}
			}
		}
	}

	.fill {}
</style>